﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace GoldenWOWLauncher.Controls
{
    /// <summary>
    /// Button.xaml 的交互逻辑
    /// </summary>
    public partial class NavigationButton : UserControl
    {
        public NavigationButton()
        {
            InitializeComponent();
        }
        public string Text
        {
            get 
            {
                if (Btn_Core.Content != null)
                    return Btn_Core.Content.ToString();
                return string.Empty;
            }
            set { Btn_Core.Content = value; }
        }

        public event RoutedEventHandler Clicked
        {
            add
            {
                Btn_Core.Click += value;
            }

            remove
            {
                Btn_Core.Click -= value;
            }
        }

        private void Button_MouseEnter(object sender, MouseEventArgs e)
        {
            //Color newColor = (Color)ColorConverter.ConvertFromString("#FF108AFB");
            //GradientStop g1 = new GradientStop(Colors.Black, 1);
            //GradientStop g2 = new GradientStop(newColor, 0);
            //GradientStopCollection gsc = new GradientStopCollection();
            //gsc.Add(g2);
            //gsc.Add(g1);
            Btn_Core.Background = new ImageBrush
            {
                ImageSource = new BitmapImage(new Uri("pack://application:,,,/GoldenWOWLauncher;component/Properties/Resources/play_no_hover.png", UriKind.RelativeOrAbsolute))
            };
            //Button1.Background = new RadialGradientBrush(gsc);
        }

        private void Button_MouseLeave(object sender, MouseEventArgs e)
        {
            Btn_Core.Background = null;
        }

       
    }
}
